package com.hluck.criminalintent.database

import androidx.lifecycle.LiveData
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.hluck.criminalintent.model.Crime
import java.util.*

/**
 *
 * @Author： LJH
 * @Time： 2023/11/20
 * @description：
 */
@Dao
interface CrimeDao {

    @Query("SELECT * FROM crime")
    fun getCrimes():LiveData<List<Crime>>

    @Query("SELECT * FROM crime WHERE id = (:id)")
    fun getCrime(id: UUID):LiveData<Crime>?

    @Insert
    fun insertCrime(crime:Crime):Long
}